import Blockly from 'blockly/core'
import 'blockly/python_compressed'
import 'blockly/blockly_compressed'
import 'blockly/blocks_compressed'

Blockly.Blocks.ast_Comment = {
  init: function () {
    this.appendDummyInput()
      .appendField('# comment')
      .appendField(new Blockly.FieldTextInput('none'), 'BODY')
    this.setInputsInline(true)
    this.setPreviousStatement(true, null)
    this.setNextStatement(true, null)
    this.setColour(230)
    this.setTooltip('')
    this.setHelpUrl('')
  }
}

Blockly.Python.ast_Comment = function (block) {
  const textBody = block.getFieldValue('BODY')
  return '#' + textBody + '\n'
}

export default Blockly
